<template>
  <div
    class="btn"
    @click="handlerclick"
    :class="{succeed:type=='succeed',error:type=='error'}"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    handlerclick(e) {
      this.$emit("click", e);
    },
  },
};
</script>


<style lang="less" scoped>
.btn {
  width: 318 * 100vw/360;
  height: 50px;
  background-color: rgb(203, 211, 198);
  border-radius: 25px;
  line-height: 50px;
  text-align: center;
  color: rgb(29, 26, 26);
  font-weight: bold;
  font-size: 20px;
}
.succeed {
  background-color: green;
  color: #ffffff;
}
.error {
  background-color: red;
  color: #ffffff;
}
</style>